package tests;

import common.Utils;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;

import java.io.IOException;

public class ListPage extends Utils {

    public static String url = "http://8.137.19.140:9090/blog_list.html";
    public ListPage() {
        super(url);
    }

    /*
    * 通过查找页面元素检查页面是否登录成功
    * */
    public void ListPageByLogin() throws InterruptedException {
        //检测是否有“注销”按钮
        driver.findElement(By.cssSelector("body > div.nav > a:nth-child(6)"));
        //检查是否有“查看全文”按钮
        driver.findElement(By.cssSelector("body > div.container > div.right > div:nth-child(1) > a"));
        //检查是否有“用户个人信息”模块
        driver.findElement(By.cssSelector("body > div.container > div.left > div"));

        Thread.sleep(2000);

        /*
        * 测试“退出系统”
        * */
        driver.findElement(By.cssSelector("body > div.nav > a:nth-child(6)")).click();

        Thread.sleep(2000);

    }



}
